{% extends "douban_base.html" %}
<!--  -->
{% block content_title %}搜索天涯-
<B>
  {{search_key_word}}
	<input type="hidden" id="search_key_word" name="search_key_word" value="{{search_key_word}}">
      
</B>

{% endblock %}
<!-- content_title -->

{% block meta %}
{{block.super}}
<link href="http://xmw-static-1.appspot.com/css/jqModal.css" rel="stylesheet" type="text/css" />
<script src="http://xmw-static-1.appspot.com/js/packed_jquery0.js"></script>
<script src="http://xmw-static-1.appspot.com/js/jqModal.js"></script>
{% endblock %}
<!-- content_title -->

{% block article %}
<div class="block_search1">
  <div class="block_top">
    <em>
    </em>
    <b>
    </b>
  </div>
  <ul class="title clearfix">
    <li class="on">
    <span>
      天涯 - 论坛
    </span>
  </li>
  <!-- 
  <li >
  <span>
    MOP - 论坛
  </span>
</li>
 -->
</ul>

<div class="ct">

  {% include "search_form.html" %}
</div>
<div class="block_bottom">
  <em>
  </em>
  <b>
  </b>
</div>
</div>

   
<input type="hidden" id="selected_id" value="0">
 {% if lst_result %}
 <div align="left"><h5>推荐{{post_count}}个搜索结果:</h5></div>
 <script language="JavaScript">
        function get_watch_value()
        {
        	var watch_form=document.getElementById("watchForm");
        	var i=0;
        	var selected_index=-1;
        	
        	for (i=0;i<watch_form.watch.length;i++)
        	{
        		if(watch_form.watch[i].checked)
        		{
        			selected_index=i;
        			break;
        		}
        	}
        	return selected_index;
        }
        			
 </script>
	{% for result in lst_result %}
<p class="ul"/>
<table width="100%">

  <tbody>
    <tr>
      
      <td valign="top">
        <div class="pl2">
          <!--  <a href={{result.url}} onclick="moreurl(this,{i:'0'})"> -->
          <a href={{result.url}} >
				<font size="3">{{result.title}}</font>
          </a>
        </div>
        <p class="pl">
          {{result.body}}
        </p>
      </td>
      <td valign="top" width="100" align="right">

      <div class="jqmWindow" id="ex{{ forloop.counter }}">
Please wait... <img src="http://xmw-static-1.appspot.com/images/busy.gif" alt="loading" />
</div>
      <script language="JavaScript">
        
      	function sub_ack_{{ forloop.counter }}()
      	{
      		
      		//alert('{{ forloop.counter }}');
      		$('#ex{{ forloop.counter }}').jqmHide();
      		var url='/j/subscribe/sub?url={{result.q_url}}&title={{result.q_title}}&seq={{ forloop.counter }}&sub_ack=true'
      		var selected_index=get_watch_value();
      		url=url+"&watch="+selected_index;
      		$('#ex{{ forloop.counter }}').jqm({ajax:url,modal:false});
      		$('#ex{{ forloop.counter }}').jqmShow();
      		      		
      	}	
      	
      	function show_it_{{ forloop.counter }}()
      	{
			
      		$('#ex{{ forloop.counter }}').jqm({ajax:'/j/subscribe/sub?url={{result.q_url}}&title={{result.q_title}}&seq={{ forloop.counter }}',modal:false});
      		$('#ex{{ forloop.counter }}').jqmShow();
      		      		
      	}	
      	
		function hide_it_{{ forloop.counter }}()
      	{

      		//$('#ex{{ forloop.counter }}').jqm({ajax:'/j/subscribe/sub?url={{result.q_url}}&title={{result.q_title}}&seq={{ forloop.counter }}',modal:false});
      		$('#ex{{ forloop.counter }}').jqmHide();
      		//$('.jqmWindow').jqmShow();
      		
      	}	
		      		
      	</script>

 		 <a  href="#" title="通过邮件阅读新帖" onclick="javascript:show_it_{{ forloop.counter }}();return false;">
          <img src="/images/mail.jpg" alt="订阅">我要订阅
        </a>

         
       
      </td>
    </tr>
  </tbody>

</table>
	{% endfor %}
 {% else %} {# if lst_result #}
 <h3><B>没有为您找到合适的帖子。建议试试其他关键字</B></h3>
 {% endif %}
 
<BR></BR><BR></BR>
  {% if lst_result %}
<div class="block_search1">
  <div class="block_top">
    <em>
    </em>
    <b>
    </b>
  </div>

  <ul class="title clearfix">
    <li class="on">
    <span>
      天涯 - 论坛
    </span>
  </li>
  

</ul>

<div class="ct">

  {% include "search_form.html" %}

</div>
 
<div class="block_bottom">
  <em>
  </em>
  <b>
  </b>
</div>
</div>
{% endif %} 
{% endblock %}
<!-- end article -->
